/// 百科数据模型
class EncyclopediaModel {
  final String encyclopediaId;
  final String name;
  final String description;
  final String imageUrl;
  final List<String> tags;
  final int viewCount;
  final int favoriteCount;
  final String category; // 'animal' 或 'plant'

  const EncyclopediaModel({
    required this.encyclopediaId,
    required this.name,
    required this.description,
    required this.imageUrl,
    required this.tags,
    required this.viewCount,
    required this.favoriteCount,
    required this.category,
  });

  /// 复制并修改模型
  EncyclopediaModel copyWith({
    String? encyclopediaId,
    String? name,
    String? description,
    String? imageUrl,
    List<String>? tags,
    int? viewCount,
    int? favoriteCount,
    String? category,
  }) {
    return EncyclopediaModel(
      encyclopediaId: encyclopediaId ?? this.encyclopediaId,
      name: name ?? this.name,
      description: description ?? this.description,
      imageUrl: imageUrl ?? this.imageUrl,
      tags: tags ?? this.tags,
      viewCount: viewCount ?? this.viewCount,
      favoriteCount: favoriteCount ?? this.favoriteCount,
      category: category ?? this.category,
    );
  }
}
